//
//  HomeMoreItemCell.m
//  SleepingElf
//
//  Created by karong on 2023/10/20.
//

#import "HomeMoreItemCell.h"

@interface HomeMoreItemCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UIImageView *bgImageView;

@end

@implementation HomeMoreItemCell
- (void)setDataWithObject:(MusicModel *)object select:(BOOL)select {
    [super setDataWithObject:object];
    [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:object.cover] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
        } completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
            if (image) {
                image = [image imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
                self.imageView.image = image;
                self.imageView.tintColor = [UIColor colorFromHexRGB:@"ffffff"];
            }
        }];
    self.bgImageView.hidden = !select;
}
@end
